#include "rle.hpp"
#include <iostream>
#include <string.h>

using namespace std;

int main()
{
	char test[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
	RLEncoder e, d;
	
	e.charge(test, sizeof(test));
	e.commitEncode();
	cout << "encode: " << sizeof(test) << " => " << e.getLength() << '\n';
	d.charge(e.getBuffer(), e.getLength());
	d.commitDecode();
	cout << "decode: " << e.getLength() << " => " << d.getLength() << '\n';
	
	cout << static_cast<const char*>(d.getBuffer()) << '\n';
	
	return 0;
}
